<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/blog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/blog/css/main.css">


<link rel="stylesheet" href="/blog/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"ios103.gitee.io","root":"/blog/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="把系统烧录进SD卡后，在boot目录下新建一个ssh为名的文件，用于开启ssh连接服务（默认关闭）。在boot目录下新建一个wpa_supplicant.conf为名的文件，打开文件，键入以下内容： 123456789101112131415161718192021country&#x3D;CNctrl_interface&#x3D;DIR&#x3D;&#x2F;var&#x2F;run&#x2F;wpa_supplicant GROUP&#x3D;netdevup">
<meta property="og:type" content="article">
<meta property="og:title" content="Raspberry指南">
<meta property="og:url" content="https://ios103.gitee.io/2020/10/10/Raspberry%E6%8C%87%E5%8D%97/index.html">
<meta property="og:site_name" content="小龙人的妙妙屋">
<meta property="og:description" content="把系统烧录进SD卡后，在boot目录下新建一个ssh为名的文件，用于开启ssh连接服务（默认关闭）。在boot目录下新建一个wpa_supplicant.conf为名的文件，打开文件，键入以下内容： 123456789101112131415161718192021country&#x3D;CNctrl_interface&#x3D;DIR&#x3D;&#x2F;var&#x2F;run&#x2F;wpa_supplicant GROUP&#x3D;netdevup">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img-blog.csdn.net/20180410164648555?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3piajE4MzE0NDY5Mzk1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70">
<meta property="og:image" content="https://img-blog.csdn.net/20180410164735787?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3piajE4MzE0NDY5Mzk1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70">
<meta property="og:image" content="https://shumeipai.nxez.com/wp-content/uploads/2018/01/20180105115447531.png">
<meta property="article:published_time" content="2020-10-10T13:06:42.000Z">
<meta property="article:modified_time" content="2020-10-12T09:42:07.686Z">
<meta property="article:author" content="小龙人">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://img-blog.csdn.net/20180410164648555?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3piajE4MzE0NDY5Mzk1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70">

<link rel="canonical" href="https://ios103.gitee.io/2020/10/10/Raspberry%E6%8C%87%E5%8D%97/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Raspberry指南 | 小龙人的妙妙屋</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/blog/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">小龙人的妙妙屋</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/blog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/blog/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/blog/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ios103.gitee.io/2020/10/10/Raspberry%E6%8C%87%E5%8D%97/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/avatar.gif">
      <meta itemprop="name" content="小龙人">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="小龙人的妙妙屋">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Raspberry指南
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-10-10 21:06:42" itemprop="dateCreated datePublished" datetime="2020-10-10T21:06:42+08:00">2020-10-10</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-10-12 17:42:07" itemprop="dateModified" datetime="2020-10-12T17:42:07+08:00">2020-10-12</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/%E6%A0%91%E8%8E%93%E6%B4%BE/" itemprop="url" rel="index"><span itemprop="name">树莓派</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>把系统烧录进SD卡后，在<code>boot</code>目录下新建一个<code>ssh</code>为名的文件，用于开启<code>ssh</code>连接服务（默认关闭）。<br>在<code>boot</code>目录下新建一个<code>wpa_supplicant.conf</code>为名的文件，打开文件，键入以下内容：</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">country=CN</span><br><span class="line">ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev</span><br><span class="line">update_config=1</span><br><span class="line"> </span><br><span class="line">network=&#123;</span><br><span class="line">        ssid=<span class="string">&quot;WiFi-A&quot;</span></span><br><span class="line">        psk=<span class="string">&quot;12345678&quot;</span></span><br><span class="line">        key_mgmt=WPA-PSK</span><br><span class="line">        priority=1</span><br><span class="line">&#125;</span><br><span class="line">network=&#123;</span><br><span class="line">        ssid=<span class="string">&quot;WiFi-B&quot;</span></span><br><span class="line">        psk=<span class="string">&quot;12345678&quot;</span></span><br><span class="line">        key_mgmt=WPA-PSK</span><br><span class="line">        priority=2</span><br><span class="line">        scan_ssid=1</span><br><span class="line">&#125;</span><br><span class="line">network=&#123;</span><br><span class="line">        ssid=<span class="string">&quot;你的无线网络名称（ssid）&quot;</span></span><br><span class="line">        key_mgmt=NONE</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<blockquote>
<p>说明以及不同安全性的 WiFi 配置示例：<br>**#ssid:网络的ssid**<br><strong>#psk:密码</strong><br><strong>#priority:连接优先级，数字越大优先级越高（不可以是负数）</strong><br><strong>#scan_ssid:连接隐藏WiFi时需要指定该值为1</strong></p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2017/09/13/raspberry-pi-network-configuration-before-boot.html">无屏幕和键盘配置树莓派WiFi和SSH</a></p>
<h3 id="虚拟键盘"><a href="#虚拟键盘" class="headerlink" title="#虚拟键盘"></a>#虚拟键盘</h3><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get install matchbox-keyboard <span class="comment">#系统自带 DISPLAY=:0.0 matchbox-keyboard -s 100 extended</span></span><br><span class="line">sudo apt-get install Florence</span><br></pre></td></tr></table></figure>



<p>####修改Swap</p>
<p>树莓派默认的虚拟内存大小才100M，有时候我们需要扩大它，这里我们修改的是/etc/dphys-swapfile</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo vim &#x2F;etc&#x2F;dphys-swapfile</span><br></pre></td></tr></table></figure>

<p>将这一行的100修改为你想要的值，单位是兆（M）</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">CONF_SWAPSIZE&#x3D;100</span><br></pre></td></tr></table></figure>

<p>保存退出后，运行</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo &#x2F;etc&#x2F;init.d&#x2F;dphys-swapfile restart</span><br></pre></td></tr></table></figure>

<p>重启dphys-swapfile服务，然后使用命令</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">free -h</span><br></pre></td></tr></table></figure>

<p>查看是否成功</p>
<p><code>use dphys-swapfile swap[on|off] for that</code></p>
<p>####树莓派如何安全关机重启</p>
<p>选择有很多一行一个关机方法。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">sudo shutdown -h now</span><br><span class="line">sudo halt </span><br><span class="line">sudo poweroff </span><br><span class="line">sudo init 0</span><br></pre></td></tr></table></figure>

<p>重启方法。</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">sudo reboot</span><br><span class="line">shutdown -r now </span><br><span class="line">shutdown -r 18:23:52 <span class="comment">#定时重启在18点23分52秒关闭</span></span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">man command #查看命令的使用手册。command 替换成你想了解的任何命令。</span><br></pre></td></tr></table></figure>

<h5 id="终端怎么退出python命令行"><a href="#终端怎么退出python命令行" class="headerlink" title="终端怎么退出python命令行"></a>终端怎么退出python命令行</h5><p><code>使用 quit(), exit(), 或者Command+d，或者Command+z退出命令行。</code></p>
<h4 id="树莓派-配置中文环境"><a href="#树莓派-配置中文环境" class="headerlink" title="树莓派 配置中文环境"></a>树莓派 配置中文环境</h4><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#更新软件安装库</span></span><br><span class="line">sudo apt-get update</span><br><span class="line"><span class="comment">#安装中文字库</span></span><br><span class="line">sudo apt-get install ttf-wqy-zenhei</span><br><span class="line"></span><br><span class="line">1.</span><br><span class="line"><span class="comment">#安装scim中文输入法</span></span><br><span class="line">sudo apt-get install scim-pinyin</span><br><span class="line">sudo scim <span class="comment">#Smart Common Input Method </span></span><br><span class="line">2.</span><br><span class="line"><span class="comment">#小企鹅输入法 (Fcitx)</span></span><br><span class="line">sudo apt-get install fcitx <span class="comment">#（安装fcitx）</span></span><br><span class="line">sudo apt-get install fcitx-pinyin <span class="comment">#（安装拼音）</span></span><br><span class="line">sudo fcitx</span><br><span class="line">3.</span><br><span class="line"><span class="comment">#安装fcitx及google拼音输入法</span></span><br><span class="line">sudo apt-get install fcitx fcitx-googlepinyin fcitx-module-cloudpinyin</span><br><span class="line"></span><br><span class="line"><span class="comment">#在terminal里面输入：</span></span><br><span class="line">sudo raspi-config</span><br><span class="line"><span class="comment">#进入bios界面找到localtion option 回车;</span></span><br><span class="line"><span class="comment">#再找到change locale 回车;</span></span><br><span class="line"><span class="comment">#找到</span></span><br><span class="line">en-GB.UTF-8 UTF-8</span><br><span class="line">zh_CN.GB2312</span><br><span class="line">zh.CN.GB18030 GB18030</span><br><span class="line">zh_CN.GBK GBK</span><br><span class="line">zh_CN.UTF-8 UTF-8</span><br><span class="line">点击空格键（重点，千万别忘记点空格键），然后回车，选择zh_CN.UTF-8 UTF-8 为默认语言。等待结束回到bios界面后点击键盘上的esc键退出bios界面，输入sudo reboot 重启树莓派;</span><br><span class="line"></span><br><span class="line"><span class="comment">#备注</span></span><br><span class="line"><span class="comment">#树莓派安装scim-pinyin 安装后ctrl+space不能切换</span></span><br><span class="line"><span class="comment">#~/.scim整个目录全部删掉，重新安装</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#包管理工具apt的图形化前端</span></span><br><span class="line">sudo apt-get install synaptic</span><br></pre></td></tr></table></figure>



<h5 id="树莓派屏幕黑边"><a href="#树莓派屏幕黑边" class="headerlink" title="树莓派屏幕黑边"></a>树莓派屏幕黑边</h5><blockquote>
<p>点击左上角树莓派图标–&gt;首选项–&gt;Raspberry Pi Configuration(树莓派配置)；</p>
<p>切换到display的TAB页， 将第一项Overscan选项修改为Disable；</p>
</blockquote>
<h5 id="如何检查树莓派的硬件版本号和型号"><a href="#如何检查树莓派的硬件版本号和型号" class="headerlink" title="如何检查树莓派的硬件版本号和型号"></a>如何检查树莓派的硬件版本号和型号</h5><blockquote>
<p>1.pinout<br>该方法还能查看其他信息，比如在树莓派上的各个GPIO针的GPIO编号位置和所板载的RAM数量。</p>
</blockquote>
<blockquote>
<p>2.cat /proc/cpuinfo<br>通用的查找树莓派硬件修订号的方法</p>
</blockquote>
<blockquote>
<p>3.cat /proc/device-tree/model</p>
<p>检查树莓派的型号</p>
</blockquote>
<blockquote>
<p>我们可以使用sysbench来运行一个简单的CPU基准测试和看看验证质数所需的时间。<br><code>$ sysbench --test=cpu --num-threads=4 --cpu-max-prime=9999 run</code></p>
</blockquote>
<h4 id="开机启动python脚本"><a href="#开机启动python脚本" class="headerlink" title="开机启动python脚本"></a>开机启动python脚本</h4><p>1./etc/rc.local</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">systemctl enable rc-local.service #默认下的rc-local.service是关闭的，需要将它启动</span><br><span class="line">sudo vi /etc/rc.local #编辑rc.local文件</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">在<span class="built_in">exit</span> 0之前编写好要启动的python脚本的绝对路径和文件名称</span></span><br><span class="line"><span class="meta">#</span><span class="bash">我的python脚本 bluetooth_control.py 放在桌面， /home/pi/Desktop/4wd_car/bluetooth_control.py</span></span><br><span class="line"><span class="meta">#</span><span class="bash">因为脚本里使用的<span class="keyword">while</span>循环，所以要添加一个 &amp;</span></span><br><span class="line">...</span><br><span class="line">python /home/pi/Desktop/4wd_car/bluetooth_control.py &amp; #add</span><br><span class="line">exit 0</span><br></pre></td></tr></table></figure>

<p>**重启树莓派 ** <code>sudo reboot</code></p>
<p>脚本方式</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash">1</span></span><br><span class="line">pi@zero:~/Documents/Internet $ sudo nano test.sh #新建运行脚本</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">编辑内容</span></span><br><span class="line"><span class="meta">#</span><span class="bash">!/bin/sh</span></span><br><span class="line">cd /home/pi/Documents/Internet</span><br><span class="line">/usr/bin/python3 test.py &gt; test.log &amp;</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">2</span></span><br><span class="line">pi@zero:~/Documents/Internet $ sudo chmod +x test.sh #赋予脚本可执行权限</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">3</span></span><br><span class="line"><span class="meta">#</span><span class="bash">编辑rc.local</span></span><br><span class="line">root@zero:~# nano /etc/rc.local</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash"> 在<span class="built_in">exit</span> 0 之前添加脚本运行路径</span></span><br><span class="line">/home/pi/Documents/Internet/./test.sh &amp;</span><br><span class="line"></span><br><span class="line">exit 0</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">4</span></span><br><span class="line"><span class="meta">#</span><span class="bash">赋予rc.local可执行权限并重启</span></span><br><span class="line">root@zero:~# sudo chmod +x rc.local</span><br><span class="line">root@zero:~# sudo reboot</span><br></pre></td></tr></table></figure>

<p>2.autostart</p>
<blockquote>
<p>这个方式不用修改 rc.local 文件。机制上类似于 Windows 的“开始”菜单中的“启动”菜单。方法如下：在 /home/pi/.config 下创建一个文件夹，名称为 autostart，并在该文件夹下创建一个xxx.desktop文件（文件名以.desktop结尾，前面可以自定义），文件内容如下：</p>
</blockquote>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">[Desktop Entry]</span><br><span class="line">Name=example</span><br><span class="line">Comment=My Python Program</span><br><span class="line">Exec=python /home/pi/example.py</span><br><span class="line">Icon=/home/pi/example.png</span><br><span class="line">Terminal=false</span><br><span class="line">MultipleArgs=false</span><br><span class="line">Type=Application</span><br><span class="line">Categories=Application;Development;</span><br><span class="line">StartupNotify=true</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<blockquote>
<p>以上 Name、Comment、Icon 可以自定，分别表示这个启动项目的名称、备注以及显示的图标。Exec 表示调用的指令，和在终端输入运行脚本的指令格式一致。<br>之后 sudo reboot 重启，就可以看到 example.py 在树莓派启动后也自动启动了。</p>
</blockquote>
<p>3.服务</p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2020/06/30/linux-usage-systemd.html">Linux 下使用 systemd 设置开机启动项</a></p>
<h6 id="Root启用管理员"><a href="#Root启用管理员" class="headerlink" title="Root启用管理员"></a>Root启用管理员</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#设置密码</span></span><br><span class="line">sudo passwd root</span><br><span class="line"><span class="comment">#解锁</span></span><br><span class="line">sudo passwd --unlock root</span><br><span class="line"><span class="comment">#切换</span></span><br><span class="line">su root</span><br></pre></td></tr></table></figure>



<p>#####NES游戏</p>
<p><code>sudo apt-get install nestopia</code></p>
<p>#####常用命令</p>
<table>
<thead>
<tr>
<th>command</th>
<th>into</th>
</tr>
</thead>
<tbody><tr>
<td>ls</td>
<td>ls是英文单词list的缩写.用来查看文件目录的属性。</td>
</tr>
<tr>
<td>stat</td>
<td>查看文件的访问时间，修改时间等</td>
</tr>
<tr>
<td>cd</td>
<td>cd 是 change directory的缩写，表示改变当前所在路径。<br /><code>cd ..</code> 上级目录 <code>cd /</code> 根目录 <code>cd ～</code>当前用户的主目录 <code>cd -</code> 上次所在目录</td>
</tr>
<tr>
<td>pwd</td>
<td>pwd 是英文print working directory 显示当前所在路径。</td>
</tr>
<tr>
<td>which</td>
<td>寻找可执行文件 ，并在PATH环境变量里面寻找</td>
</tr>
<tr>
<td>touch</td>
<td>将每个文件的访问及修改时间都更新为目前的时间。<br />如果文件不存在，则创建一个字节数为0的文件。</td>
</tr>
<tr>
<td>mkdir</td>
<td>mkdir 是make directory的英文缩写。<br />创建目录DIRECTORY，可以一次创建多个。OPTION如果是­p，表示可以连同父目录一起创建。</td>
</tr>
<tr>
<td>rmdir</td>
<td>rmdir是remove directory的英文缩写。</td>
</tr>
<tr>
<td>rm</td>
<td>rm是remove的英文缩写。<br />可以用来删除普通文件，也可以用来删除目录，特别用来删除目录中嵌套有子目录的目录文件。<br/>常用参数：</td>
</tr>
<tr>
<td>mv</td>
<td>mv是英文单词move的缩写。可以用来移动文件夹或者文件，也可以用来更改文件名。</td>
</tr>
<tr>
<td>cp</td>
<td>cp是英文单词copy的缩写，表示拷贝文件。</td>
</tr>
<tr>
<td>cat</td>
<td>cat英文单词concatenate连锁的缩写，用来查看文件内容，以及将几个文件连成一个文件</td>
</tr>
<tr>
<td>more</td>
<td>more 是我们最常用的工具之一，最常用的就是显示输出的内容，然后根据窗口的大小进行分页显示，并且提示文件的百分比。</td>
</tr>
<tr>
<td>less</td>
<td>less工具也是对文件或其它输出进行分页显示的工具</td>
</tr>
<tr>
<td>tree -d</td>
<td>显示目录树</td>
</tr>
<tr>
<td>clear</td>
<td>清除终端窗口</td>
</tr>
<tr>
<td>sudo halt:</td>
<td>关闭Raspberry Pi</td>
</tr>
<tr>
<td>sudo reboot</td>
<td>重新启动Raspberry Pi</td>
</tr>
<tr>
<td>startx</td>
<td>启动桌面环境（LXDE）</td>
</tr>
</tbody></table>
<p>#####文件和文件夹操作权限：</p>
<table>
<thead>
<tr>
<th align="left">权限</th>
<th align="left">简写</th>
<th align="left">对普通文件的作用</th>
<th align="left">对文件夹的作用</th>
</tr>
</thead>
<tbody><tr>
<td align="left">读取</td>
<td align="left">r</td>
<td align="left">查看文件内容</td>
<td align="left">列出文件夹中的文件(ls)</td>
</tr>
<tr>
<td align="left">写入</td>
<td align="left">w</td>
<td align="left">修改文件内容</td>
<td align="left">在文件夹中删除、添加或重命名文件(夹)</td>
</tr>
<tr>
<td align="left">执行</td>
<td align="left">x</td>
<td align="left">文件可以作为程序执行</td>
<td align="left">cd 到文件夹</td>
</tr>
</tbody></table>
<p><img src="https://img-blog.csdn.net/20180410164648555?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3piajE4MzE0NDY5Mzk1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70" alt="图解"></p>
<p><img src="https://img-blog.csdn.net/20180410164735787?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3piajE4MzE0NDY5Mzk1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70" alt="图解"></p>
<p>#####SSH</p>
<blockquote>
<p>软件配置工具 Raspberry Pi Software Configuration Tool(raspi-config)</p>
</blockquote>
<p><code>sudo raspi-config</code><br><a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_42455305/article/details/80687002">树莓派官方设置工具 raspi-config 说明</a></p>
<blockquote>
<p>SSH的默认端口是22，也就是说，你的登录请求会送进远程主机的22端口。使用p参数，可以修改这个端口。</p>
<p>ssh -p 2222 user@host</p>
</blockquote>
<p>#####NTP(Network Time Protocol)</p>
<blockquote>
<p>树莓派默认安装了NTP(Network Time Protocol)服务来获取互联网上ntp服务器提供的时间</p>
<p>在 <code>/etc/ntp.conf</code> 中添加一行 <code>server ntp.tuna.tsinghua.edu.cn</code> 即可(清华源)<br>末尾加上 <code>perfer</code>表示优先使用此服务器</p>
</blockquote>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo /etc/init.d/ntp restart</span><br></pre></td></tr></table></figure>

<p>#####更换国内源</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash">1.修改 sources.list 文件</span></span><br><span class="line">sudo nano /etc/apt/sources.list</span><br><span class="line"><span class="meta">#</span><span class="bash">用<span class="comment">#注释掉原文件内容，用以下内容取代：</span></span></span><br><span class="line">deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi</span><br><span class="line">deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">这里我用的是是清华源，在后面若下载出错换中科大源试试（Ps：中科大的源地址http://mirrors.ustc.edu.cn/raspbian/raspbian/对应替换就行)</span></span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">②在终端输入以下指令**</span></span><br><span class="line">sudo nano /etc/apt/sources.list.d/raspi.list</span><br><span class="line"><span class="meta">#</span><span class="bash">用<span class="comment">#注释掉原文件内容，用以下内容取代：</span></span></span><br><span class="line">deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui</span><br><span class="line">deb-src http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">③使用命令更新软件源列表，同时检查编辑是否正确。再更新软件</span></span><br><span class="line">sudo apt-get update</span><br><span class="line">sudo apt-get upgrade</span><br><span class="line"></span><br></pre></td></tr></table></figure>


<p>#####软件安装命令apt-get</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash">安装包</span></span><br><span class="line">sudo apt-get install xxx </span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">强制安装</span></span><br><span class="line">sudo apt-get -f install xxx</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">重新安装</span></span><br><span class="line">sudo apt-get reinstall xxx</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">删除包</span></span><br><span class="line">sudo apt-get remove xxx</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">删除包，包括删除配置文件等</span></span><br><span class="line">sudo apt-get remove xxx --purge</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">删除包及其依赖的软件包+配置文件等（只对6.10有效，强烈推荐）</span></span><br><span class="line">sudo apt-get autoremove xxx --purge</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">更新软件列表</span></span><br><span class="line">sudo apt-get update</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">更新所有已安装的包</span></span><br><span class="line">sudo apt-get upgrade</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">升级系统</span></span><br><span class="line">sudo apt-get dist-upgrade</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">下载该包的源代码</span></span><br><span class="line">apt-get source xxx</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">清理下载文件的存档 &amp;&amp; 只清理过时的包</span></span><br><span class="line">sudo apt-get clean &amp;&amp; sudo apt-get autoclean</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">检查是否有损坏的依赖</span></span><br><span class="line">sudo apt-get check</span><br><span class="line"></span><br><span class="line">注：apt-get新下载的软件包位置</span><br><span class="line">/var/cache/apt/archieve下的都是软件的安装缓存</span><br><span class="line">sudo apt-get autoclean（只删除低版本的deb包）</span><br><span class="line">sudo apt-get clean（全部删除）</span><br><span class="line">一般的deb包都安装在：/usr或/usr/share或/usr/local目录中</span><br></pre></td></tr></table></figure>

<h5 id="软件"><a href="#软件" class="headerlink" title="软件"></a>软件</h5><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install gedit <span class="comment">#gedit编辑器</span></span><br></pre></td></tr></table></figure>

<blockquote>
<p>OpenMediaVault，是一个开源的基于 Debian Linux 的下一代网络附加存储（NAS）解决方案</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2020/09/22/getting-started-with-omv-on-a-raspberry-pi.html">在树莓派上安装 OpenMediaVault（OMV）</a></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2020/09/11/pishrink-make-raspberry-pi-images-smaller.html">PiShrink：制作更小的树莓派镜像文件</a></p>
<h4 id="文章"><a href="#文章" class="headerlink" title="文章"></a>文章</h4><p><a target="_blank" rel="noopener" href="https://www.basemu.com/raspberry-4-raspbian-buster-modification-sources-list.html">更换软件源</a></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2013/12/26/linux-on-vim-editor-tutorials.html">Linux上vi(vim)编辑器使用教程</a></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2014/09/06/raspberry-pi-vim-code-highlighting.html">树莓派vim代码高亮</a></p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get remove vim-common</span><br><span class="line">sudo apt-get install vim #安装vim</span><br><span class="line">pi@raspberrypi ~ $ cd ~</span><br><span class="line">pi@raspberrypi ~ $ vim .vimrc</span><br><span class="line"> </span><br><span class="line"><span class="meta">#</span><span class="bash">编辑内容</span></span><br><span class="line">set nu  #显示行号</span><br><span class="line">syntax on  #语法高亮</span><br><span class="line">set tabstop=4  #tab退四格</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install retext #Markdown 编辑器 </span><br></pre></td></tr></table></figure>

<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2014/11/17/raspberry-pi-taking-screenshots-with-scrot.html">在树莓派上截屏的方法</a></p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get install scrot #安装</span><br><span class="line">sudo scrot -h #帮助</span><br></pre></td></tr></table></figure>

<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2015/01/03/raspberry-pi-software-installation-and-uninstallation-command.html">树莓派上的软件安装和卸载命令汇总</a></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2018/01/05/directory-introduction-in-raspbian.html">Linux/Raspbian 每个目录用途说明</a></p>
<table>
<thead>
<tr>
<th>目录</th>
<th>注释</th>
</tr>
</thead>
<tbody><tr>
<td>/</td>
<td>根路径</td>
</tr>
<tr>
<td>/boot</td>
<td>启动文件（boot loader）</td>
</tr>
<tr>
<td>/sys</td>
<td>目录下包含内核、固件以及系统相关文件</td>
</tr>
<tr>
<td>/sbin</td>
<td>包含系统操作和运作所必需的二进制文件以及管理工具，<br />主要就是可执行文件。类似WINDOWS下的EXE文件</td>
</tr>
<tr>
<td>/bin</td>
<td>包含单用户模式下的二进制文件以及工具程序，比如cat，ls，cp这些命令</td>
</tr>
<tr>
<td>/lib</td>
<td>包含/sbin和/bin目录下二进制文件运行所需要的库文件</td>
</tr>
<tr>
<td>/dev</td>
<td>内含必需的系统文件和驱动器</td>
</tr>
<tr>
<td>/etc</td>
<td>内含系统配置文件，其下的目录，比如 /etc/hosts, /etc/resolv.conf, nsswitch.conf, 以及系统缺省设置，网络配置文件等等。以及一些系统和应用程序的配置文件</td>
</tr>
<tr>
<td>/home</td>
<td>每一个用户的在这个目录下，都会单独有一个以其用户名命令的目录，在这里保存着用户的个人设置文件，尤其是以 profile结尾的文件。但是也有例外，root用户的数据就不在这个目录中，而是单独在根路径下，保存在单独的/root文件夹下</td>
</tr>
<tr>
<td>/media</td>
<td>一个给所有可移动设备比如光驱、USB外接盘、软盘提供的常规挂载点。</td>
</tr>
<tr>
<td>/mnt</td>
<td>临时文件系统挂载点。比如，你并不想长期挂载某个驱动器，而是只是临时挂载一会U盘烤个MP3之类的，那么应该挂载在这个位置下。</td>
</tr>
<tr>
<td>/opt</td>
<td>在Linux系统中，这个目录用到的并不多，opt是 可选系统程序包（Optional Software Packages）的简称。这个目录在UNIX系统，如Sun Solaris用途要广泛的多。</td>
</tr>
<tr>
<td>/usr</td>
<td>用户数据目录，包含了属于用户的实用程序和应用程序。这里有很多重要的，但并非关键的文件系统挂载这个路径下面。在这里，你会重新找到一个 bin、sbin 和 lib目录，其中包含非关键用户和系统二进制文件以及相关的库和共享目录，以及一些库文件。</td>
</tr>
<tr>
<td>/usr/sbin</td>
<td>包含系统中非必备和并不是特别重要的系统二进制文件以及网络应用工具。</td>
</tr>
<tr>
<td>/usr/bin</td>
<td>包含用户的非必备和并不是特别重要的二进制文件。</td>
</tr>
<tr>
<td>/usr/lib</td>
<td>保存着/usr/sbin以及/usr/bin中二进制文件所需要的库文件。</td>
</tr>
<tr>
<td>/usr/share</td>
<td>“平台无关”的共享数据目录。</td>
</tr>
<tr>
<td>/usr/local</td>
<td>是/usr下的二级目录，这里主要保存着包含系统二进制文件以及运行库在内的本地系统数据。</td>
</tr>
<tr>
<td>/var</td>
<td>这个路径下通常保存着包括系统日志、打印机后台文件（spool files）、定时任务（crontab）、邮件、运行进程、进程锁文件等。这个目录尤其需要注意进行日常的检查和维护，因为这个目录下文件的大小可能会增长很快，以致于很快占满硬盘，然后导致系统便会出现各种奇奇怪怪的问题。</td>
</tr>
<tr>
<td>/tmp</td>
<td>顾名思义，这是一个临时文件夹，专门用来保存临时文件，每次系统重启之后，这个目录下的”临时”文件便会被清空。同样，/var/tmp 也同样保存着临时文件。两者唯一的不同是，后者 /var/tmp目录保存的文件会受到系统保护，系统重启之后这个目录下的文件也不会被清空。</td>
</tr>
<tr>
<td>/proc</td>
<td>这个目录是驻留在系统内存中的虚拟（psuedo，伪）文件系统，其中保存的都是文本格式的系统内核和进程信息。</td>
</tr>
</tbody></table>
<h4 id="LINUX系统目录结构图"><a href="#LINUX系统目录结构图" class="headerlink" title="LINUX系统目录结构图"></a>LINUX系统目录结构图</h4><p><img src="https://shumeipai.nxez.com/wp-content/uploads/2018/01/20180105115447531.png" alt="目录结构"></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2019/12/11/scheduling-tasks-with-cron.html">树莓派计划任务的配置方法</a></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2018/08/31/raspberry-pi-vnc-viewer-configuration-tutorial.html">树莓派 VNC Viewer 远程桌面配置教程</a></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2019/07/08/set-the-resolution-of-the-raspberry-pi-vnc.html">如何设置树莓派 VNC 的分辨率</a></p>
<blockquote>
<p>VNC许可密钥<br>输入一个有效的密钥：5D7L8-ZQXSA-2L5D4-4UFB4-PWDLA   或77NVU-D9G5T-79ESS-V9Y6X-JMVGA</p>
<p>ELBMU-ZFYMV-2HC77-73M46-UL4TA97KLJ-VBTAL-T7GN2-K29PS-ANXCA45YV6-WXWMJ-NPAAV-HWD7Q-W5HVAL76HR-6428G-Q8JAX-7PSSH-ZWYKAEQ48W-C5MQJ-44A2K-5GB2T-NECWA</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://ipcmen.com/">Linux命令大全（手册）-Linux常用命令实例详解</a></p>
<p><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/59012890">树莓派入门必会的20个Linux命令</a></p>
<p><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/59144799">树莓派初次启动后的设置</a></p>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/blog/2020/10/10/hello-world/" rel="prev" title="Hello World">
      <i class="fa fa-chevron-left"></i> Hello World
    </a></div>
      <div class="post-nav-item">
    <a href="/blog/2020/10/12/%E6%A0%91%E8%8E%93%E6%B4%BE3B%E8%A7%84%E6%A0%BC-GPIO%E5%BC%95%E8%84%9A%E5%9B%BE-%E8%B4%9F%E8%BD%BD%E7%94%B5%E6%B5%81%E5%8F%82%E8%80%83/" rel="next" title="树莓派3B规格-GPIO引脚图-负载电流参考">
      树莓派3B规格-GPIO引脚图-负载电流参考 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%99%9A%E6%8B%9F%E9%94%AE%E7%9B%98"><span class="nav-number">1.</span> <span class="nav-text">#虚拟键盘</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#%E7%BB%88%E7%AB%AF%E6%80%8E%E4%B9%88%E9%80%80%E5%87%BApython%E5%91%BD%E4%BB%A4%E8%A1%8C"><span class="nav-number">1.0.1.</span> <span class="nav-text">终端怎么退出python命令行</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%A0%91%E8%8E%93%E6%B4%BE-%E9%85%8D%E7%BD%AE%E4%B8%AD%E6%96%87%E7%8E%AF%E5%A2%83"><span class="nav-number">1.1.</span> <span class="nav-text">树莓派 配置中文环境</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#%E6%A0%91%E8%8E%93%E6%B4%BE%E5%B1%8F%E5%B9%95%E9%BB%91%E8%BE%B9"><span class="nav-number">1.1.1.</span> <span class="nav-text">树莓派屏幕黑边</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E5%A6%82%E4%BD%95%E6%A3%80%E6%9F%A5%E6%A0%91%E8%8E%93%E6%B4%BE%E7%9A%84%E7%A1%AC%E4%BB%B6%E7%89%88%E6%9C%AC%E5%8F%B7%E5%92%8C%E5%9E%8B%E5%8F%B7"><span class="nav-number">1.1.2.</span> <span class="nav-text">如何检查树莓派的硬件版本号和型号</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8python%E8%84%9A%E6%9C%AC"><span class="nav-number">1.2.</span> <span class="nav-text">开机启动python脚本</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#Root%E5%90%AF%E7%94%A8%E7%AE%A1%E7%90%86%E5%91%98"><span class="nav-number">1.2.0.1.</span> <span class="nav-text">Root启用管理员</span></a></li></ol></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E8%BD%AF%E4%BB%B6"><span class="nav-number">1.2.1.</span> <span class="nav-text">软件</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%96%87%E7%AB%A0"><span class="nav-number">1.3.</span> <span class="nav-text">文章</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#LINUX%E7%B3%BB%E7%BB%9F%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84%E5%9B%BE"><span class="nav-number">1.4.</span> <span class="nav-text">LINUX系统目录结构图</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">小龙人</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/blog/archives/">
        
          <span class="site-state-item-count">7</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/blog/categories/">
          
        <span class="site-state-item-count">2</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">小龙人</span>
</div>

<!-- 用下面的符号注释，注释代码用下面括号括起来 -->
<!--
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

-->

        








      </div>
    </footer>
  </div>

  
  <script src="/blog/lib/anime.min.js"></script>
  <script src="/blog/lib/velocity/velocity.min.js"></script>
  <script src="/blog/lib/velocity/velocity.ui.min.js"></script>

<script src="/blog/js/utils.js"></script>

<script src="/blog/js/motion.js"></script>


<script src="/blog/js/schemes/pisces.js"></script>


<script src="/blog/js/next-boot.js"></script>




  















  

  

</body>
</html>

<!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/src/clicklove.js"></script>
